<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>linkify (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">string.linkify</span>
</div>

<hr/>


  <h2>Classes</h2>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.string.linkify.findFirstEmail"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">findFirstEmail<span class="args">(<span class="arg">text</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Gets the first email address in text.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">text</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Plain text.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The first email address, or an empty string if not found.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line126">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.string.linkify.findFirstUrl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">findFirstUrl<span class="args">(<span class="arg">text</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Gets the first URI in text.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">text</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Plain text.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The first URL, or an empty string if not found.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line115">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.string.linkify.linkifyPlainText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">linkifyPlainText<span class="args">(<span class="arg">text</span>,&nbsp;<span class="arg">opt_attributes</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Takes a string of plain text and linkifies URLs and email addresses. For a
URL (unless opt_attributes is specified), the target of the link will be
_blank and it will have a rel=nofollow attribute applied to it so that links
created by linkify will not be of interest to search engines.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">text</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Plain text.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_attributes</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>,<span class="type"> string></span>&gt;
        <div class="entryOverview">Attributes to add to all
     links created. Default are rel=nofollow and target=blank. To clear those
     default attributes set rel='' and target='_blank'.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            HTML Linkified HTML text.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line36">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.ACCEPTABLE_URL_CHARS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">ACCEPTABLE_URL_CHARS_</span>
        : 
     </div>


     <div class="entryOverview">
       Set of characters to be put into a regex character set ("[...]"), used to
match against a url hostname and everything after it. It includes
"#-@", which represents the characters "#$%&amp;'()*+,-./0123456789:;&lt;=&gt;?@".

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line159">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.EMAIL_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">EMAIL_</span>
        : 
     </div>


     <div class="entryOverview">
       Regular expression pattern that matches an email.
Contains a catching group to capture the email without the optional "mailto:"
prefix.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line228">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.ENDING_PUNCTUATION_CHARS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">ENDING_PUNCTUATION_CHARS_</span>
        : 
     </div>


     <div class="entryOverview">
       If a series of these characters is at the end of a url, it will be considered
punctuation and not part of the url.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line139">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.ENDS_WITH_PUNCTUATION_RE_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">ENDS_WITH_PUNCTUATION_RE_</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line147">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.FIND_LINKS_RE_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">FIND_LINKS_RE_</span>
        : 
     </div>


     <div class="entryOverview">
       Regular expression to match all the links (url or email) in a string.
First match is text before first link, might be empty string.
Second match is the original text that should be replaced by a link.
Third match is the email address in the case of an email.
Fourth match is the scheme of the url if specified.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line243">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.PROTOCOL_START_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">PROTOCOL_START_</span>
        : 
     </div>


     <div class="entryOverview">
       Regular expression pattern that matches the beginning of an url.
Contains a catching group to capture the scheme.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line179">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.RECOGNIZED_PROTOCOLS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">RECOGNIZED_PROTOCOLS_</span>
        : 
     </div>


     <div class="entryOverview">
       List of all protocols patterns recognized in urls (mailto is handled in email
matching).

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line169">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.TOP_LEVEL_DOMAIN_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">TOP_LEVEL_DOMAIN_</span>
        : 
     </div>


     <div class="entryOverview">
       Regular expression pattern that matches a top level domain.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line211">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.URL_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">URL_</span>
        : 
     </div>


     <div class="entryOverview">
       Regular expression pattern that matches an url.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line199">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.string.linkify.WWW_START_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.string.linkify.</span><span class="entryName">WWW_START_</span>
        : 
     </div>


     <div class="entryOverview">
       Regular expression pattern that matches the beginning of a typical
http url without the http:// scheme.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_string_linkify.js.source.html#line190">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package string</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="string.linkify"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
